package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the ORDEN database table.
 * 
 */
@Entity
@Table(name="ORDEN")
public class Orden implements Serializable {
	private static final long serialVersionUID = 1L;
	private long refnumOrden;
	private String agntSync;
	private String anOrden;
	private BigDecimal numOrden;
	private String oficRegId;
	private BigDecimal refnumTitu;
	private String regPubId;
	private Date tsPresenta;
	private Date tsUltSync;
	private Set<Recibo> recibos;
	private Set<TituloOrden> tituloOrdens;

    public Orden() {
    }


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="REFNUM_ORDEN", unique=true, nullable=false)
	public long getRefnumOrden() {
		return this.refnumOrden;
	}

	public void setRefnumOrden(long refnumOrden) {
		this.refnumOrden = refnumOrden;
	}


	@Column(name="AGNT_SYNC", length=4)
	public String getAgntSync() {
		return this.agntSync;
	}

	public void setAgntSync(String agntSync) {
		this.agntSync = agntSync;
	}


	@Column(name="AN_ORDEN", length=4)
	public String getAnOrden() {
		return this.anOrden;
	}

	public void setAnOrden(String anOrden) {
		this.anOrden = anOrden;
	}


	@Column(name="NUM_ORDEN", precision=6)
	public BigDecimal getNumOrden() {
		return this.numOrden;
	}

	public void setNumOrden(BigDecimal numOrden) {
		this.numOrden = numOrden;
	}


	@Column(name="OFIC_REG_ID", nullable=false, length=2)
	public String getOficRegId() {
		return this.oficRegId;
	}

	public void setOficRegId(String oficRegId) {
		this.oficRegId = oficRegId;
	}


	@Column(name="REFNUM_TITU", nullable=false)
	public BigDecimal getRefnumTitu() {
		return this.refnumTitu;
	}

	public void setRefnumTitu(BigDecimal refnumTitu) {
		this.refnumTitu = refnumTitu;
	}


	@Column(name="REG_PUB_ID", nullable=false, length=2)
	public String getRegPubId() {
		return this.regPubId;
	}

	public void setRegPubId(String regPubId) {
		this.regPubId = regPubId;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="TS_PRESENTA")
	public Date getTsPresenta() {
		return this.tsPresenta;
	}

	public void setTsPresenta(Date tsPresenta) {
		this.tsPresenta = tsPresenta;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="TS_ULT_SYNC")
	public Date getTsUltSync() {
		return this.tsUltSync;
	}

	public void setTsUltSync(Date tsUltSync) {
		this.tsUltSync = tsUltSync;
	}


	//bi-directional many-to-one association to Recibo
	@OneToMany(mappedBy="orden")
	public Set<Recibo> getRecibos() {
		return this.recibos;
	}

	public void setRecibos(Set<Recibo> recibos) {
		this.recibos = recibos;
	}
	

	//bi-directional many-to-one association to TituloOrden
	@OneToMany(mappedBy="orden")
	public Set<TituloOrden> getTituloOrdens() {
		return this.tituloOrdens;
	}

	public void setTituloOrdens(Set<TituloOrden> tituloOrdens) {
		this.tituloOrdens = tituloOrdens;
	}
	
}